//--------------------------------------------------------------------------------
// This file is a portion of the D2D1Renderer.  It is distributed
// under the MIT License, available in the root of this distribution and 
// at the following URL:
//
// http://www.opensource.org/licenses/mit-license.php
//
// Copyright (c) Mirco Timmermann
//
//--------------------------------------------------------------------------------
#pragma once

#include "..\DisplayObject.h"
#include "..\Text.h"


namespace D2 {

class Button : public DisplayObject {
	friend class ScrollBarContainer;

public:
	enum ScrollBarType {
		VERTICAL, 
		HORIZONTAL
	};

public:
	Button(int x, int y, int width, int height); //, ScrollBarType type);
	~Button(void);

	virtual bool Draw(Direct2DContext* ctx, D2D1::Matrix3x2F* mtx = 0);

private:
	bool _pressed;
	bool _highlight;

	Text* _text;

public:
	bool _toggle;

public:
	virtual void OnMouseOver(const MouseEvent &e);
	virtual void OnMouseOut(const MouseEvent &e);
	virtual void OnMouseDown0(const MouseEvent &e);
	virtual void OnMouseUp0(const MouseEvent &e);
	virtual void OnMouseLeave0(const MouseEvent &e);

public:
	void SetText(std::string text);
	std::string GetText();

};

}